package com.lqian.demo02.utils.test.dao.mapper;


import com.lqian.demo02.utils.test.pojo.Users;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author：Melody_LQ
 * @time：2022/7/14 4:01 下午
 */
public class UserRowMapper implements RowMapper<Users>{
    @Override
    public Users getRow(ResultSet rs) {
        Users users = null;
        try {
            int id = rs.getInt("id");
            String name = rs.getString("name");
            String password = rs.getString("password");
            String email = rs.getString("email");
            Date birthday = rs.getDate("birthday");

            return users = new Users(id,name,password,email,birthday);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
